package com.edu.hre.struts.form.survey;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.struts.action.ActionForm;

import com.edu.hre.common.utils.CommonUtils;

public class SurveyTakeUpdateForm extends ActionForm {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3528566074746044550L;

	private Integer id;
	private String name;
	private int subunitId;
	private String subunit;
	private Date startDate;
	private Date endDate;
	private int userCreated;
	private String user;
	private Date dateCreated;
	private Date dateModified;
	
	private String html = "";
	private boolean taken;
	private boolean alowUpdate = true;
	
	private boolean isSelected;
	private boolean isAddNew;
	
	public SurveyTakeUpdateForm() {
		// TODO Auto-generated constructor stub
	} 
	
	
	public SurveyTakeUpdateForm(Integer id, String name, int subunitId, String subunit, Date startDate, Date endDate, int userCreated, String user,
			Date dateCreated, Date dateModified) {
		super();
		this.id = id;
		this.name = name;
		this.subunitId = subunitId;
		this.subunit = subunit;
		this.startDate = startDate;
		this.endDate = endDate;
		this.userCreated = userCreated;
		this.user = user;
		this.dateCreated = dateCreated;
		this.dateModified = dateModified;
	}


	public boolean getIsAddNew() {
		return isAddNew;
	}

	public void setIsAddNew(boolean isAddNew) {
		this.isAddNew = isAddNew;
	}
	
	public boolean getIsSelected() {
		return isSelected;
	}

	public void setIsSelected(boolean isSelected) {
		this.isSelected = isSelected;
	}
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getSubunitId() {
		return subunitId;
	}

	public void setSubunitId(int subunitId) {
		this.subunitId = subunitId;
	}

	public String getSubunit() {
		return subunit;
	}

	public void setSubunit(String subunit) {
		this.subunit = subunit;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public int getUserCreated() {
		return userCreated;
	}

	public void setUserCreated(int userCreated) {
		this.userCreated = userCreated;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public Date getDateCreated() {
		return dateCreated;
	}

	public void setDateCreated(Date dateCreated) {
		this.dateCreated = dateCreated;
	}

	public Date getDateModified() {
		return dateModified;
	}

	public void setDateModified(Date dateModified) {
		this.dateModified = dateModified;
	}

	public boolean isAddNew() {
		return isAddNew;
	}

	public void setAddNew(boolean isAddNew) {
		this.isAddNew = isAddNew;
	}

	public boolean isSelected() {
		return isSelected;
	}

	public void setSelected(boolean isSelected) {
		this.isSelected = isSelected;
	}
	
	private static final SimpleDateFormat dateFormat2 = new SimpleDateFormat("MM/dd/yyyy");
	public String getStartDateStr() {
		try {
			return dateFormat2.format(startDate);
		} catch (Exception e) {
			return "";
		}
	}

	public void setStartDateStr(String startDate) {
		try {
			this.startDate = dateFormat2.parse(startDate);
		} catch (Exception e) {
			CommonUtils.println(e.getMessage());
		}
	}

	public String getEndDateStr() {
		try {
			return dateFormat2.format(endDate);
		} catch (Exception e) {
			CommonUtils.println(e.getMessage());
			return "";
		}
	}

	public void setEndDateStr(String endDate) {
		try {
			this.endDate = dateFormat2.parse(endDate);
		} catch (Exception e) {
			CommonUtils.println(e.getMessage());
		}
	}


	public String getHtml() {
		return html;
	}


	public void setHtml(String html) {
		this.html = html;
	}

	public boolean getTaken() {
		return taken;
	}

	public void setTaken(boolean taken) {
		this.taken = taken;
	}


	public boolean getAlowUpdate() {
		return alowUpdate;
	}


	public void setAlowUpdate(boolean alowUpdate) {
		this.alowUpdate = alowUpdate;
	}

}
